<?php
namespace app\mini_api\controller;

use think\Loader;
class Question extends Permission
{
    public function _initialize()
    {
        parent::_initialize();

    }

    public function getByDriverExamId()
    {
        # 视频信息
        $map['driver_exam_id'] = $this->input_data['id'];
        $result = db('DriverExamQuestion')->alias('a')->join('question c','a.question_id = c.id','LEFT')->field('a.*,c.title,c.answer,c.type,c.result')->where($map)->select();

        $list = [];

        foreach ($result as $v) {
            $v['answer'] = explode(',', $v['answer']);

            $v['type'] = getQuestionType($v);


            $list[] = $v;
        }

        

        

        $this->resSuc($list);
    }

}
